<?php
/**
 * Created by 陈俊伟.
 * User: Administrator
 * Date: 2019-11-13
 * Time: 下午 6:59
 */

namespace App\Lib\Naipan;
/*
 * 奶盘网api封装
 * */
class Naipan
{
    private $regname = '3396666329@qq.com';
    private $regsn = 'GDDJJYM1U2A7707T2P1WXKVFKL26SWEP';
    private $query_url = 'http://www.naipan.com/open/weiyuanchuang/towei.html';

    public function textTran($text = '')
    {
        $data = array(
            'regname' => $this->regname,
            'regsn' => $this->regsn,
            'content' => $text
        );
        $result = curlPost($this->query_url, $data);

        $res = '';
        if($result){
            $tmp = json_decode($result,true);
            if($tmp['result'] == 1){
                $res = $tmp['content'];
            }
        }

        return $res;
    }
}